package com.dingwen.auause.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dingwen.auause.entity.PermissionEntity;
import com.dingwen.auause.mapper.PermissionMapper;
import com.dingwen.auause.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * permission service impl
 *
 * @author dingwen
 * 2021.05.12 16:30
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, PermissionEntity> implements PermissionService {

    private final PermissionMapper permissionMapper;

    @Autowired
    PermissionServiceImpl(PermissionMapper permissionMapper) {
        this.permissionMapper = permissionMapper;
    }

    @Override
    public List<PermissionEntity> getPermissionsByUserId(Long userId) {
        return permissionMapper.getPermissionsByUserId(userId);
    }
}
